package com.qianfeng.exam.mapper;

import com.qianfeng.exam.pojo.Categories;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CategoryMapper {
    @Insert("insert into categories(categoryname)value(#{categoryname})")
    @Options(useGeneratedKeys=true,keyProperty="categoryid")//添加记录并返回数据库自增加的ID
    void addCategory(Categories categories);
    @Select("select * from categories")
    List<Categories> findAllCategory();
}
